<?php
require_once("admin_header.php");
require_once("../include/check_get_key.php");
$cid = intval($_GET['cid']);
if (!isset($_SESSION['administrator']) && !isset($_SESSION[$BM_ADMIN]))
    exit();
$sql    = "select `contest_active` FROM `cr_contest` WHERE `contest_id`=$cid";
$result = mysql_query($sql);
$num    = mysql_num_rows($result);
if ($num < 1) 
{
    mysql_free_result($result);
    echo "No Such Contest!";
    require_once("../bm-footer.php");
    exit(0);
}
$row = mysql_fetch_row($result);
if ($row[0] == 'N')
    $sql = "UPDATE `cr_contest` SET `contest_active`='Y' WHERE `contest_id`=$cid";
else
    $sql = "UPDATE `cr_contest` SET `contest_active`='N' WHERE `contest_id`=$cid";
mysql_free_result($result);
mysql_query($sql);

?>
<script language=javascript>
	history.go(-1);
</script>
